package com.xingkeduo.remote.feign;

import com.xingkeduo.config.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;


//用户服务远程调用
@FeignClient(name = "thirdparty-oss",configuration = MultipartSupportConfig.class)
public interface OssFeignService  {

    //图片上传
    @RequestMapping(value = "/oss/comment", method = RequestMethod.POST,
            produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},
            consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String uploadComment(@RequestPart(value = "file", required = false) MultipartFile file);

}
